package com.sddz.pacs.controller;

import com.github.pagehelper.PageInfo;
import com.sddz.pacs.annotation.SysLogger;
import com.sddz.pacs.dto.JsonResult;
import com.sddz.pacs.dto.PageModelParams;
import com.sddz.pacs.entity.SysLog;
import com.sddz.pacs.entity.SysUser;
import com.sddz.pacs.service.SysLogService;
import com.sddz.pacs.support.ResultConstant;
import com.sddz.pacs.util.ShiroUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author SunLi
 * @Date 2018/9/18
 */
@RestController
@RequestMapping("/sysLog")
@Api(value = "日志管理")
public class SysLogController {
    @Autowired
    private SysLogService sysLogService;

    @PostMapping("/list")
    @SysLogger(value = "查询日志列表",type = "日志管理")
    @ApiOperation(value="获取日志分类列表", notes="获取日志分页立标")
    @ApiImplicitParam(name = "pageModelParams",value = "分页参数json对象",required = true)
    public JsonResult list(@RequestBody PageModelParams pageModelParams){
        PageInfo<SysLog> pageInfo = sysLogService.selectListByCondition(pageModelParams);
        return JsonResult.success(pageInfo, ResultConstant.LIST_SUCCESS);
    }

}
